<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.io.StringParser.parseTruth</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d3/dca/classnars_1_1io_1_1StringParser_a49d3b8184f455de9685937d0aa2f6a93.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="a49d3b8184f455de9685937d0aa2f6a93"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a> nars.io.StringParser.parseTruth </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>parse the input String into a TruthValue (or DesireValue) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>input String </td></tr>
    <tr><td class="paramname">type</td><td>Task type </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the input TruthValue </dd></dl>

<p>Definition at line <a class="el" href="../../d7/dcd/StringParser_8java_source.html#l00173">173</a> of file <a class="el" href="../../d7/dcd/StringParser_8java_source.html">StringParser.java</a>.</p>

<p>References <a class="el" href="../../db/d0c/Memory_8java_source.html#l01106">nars.storage.Memory.Parameters.DEFAULT_JUDGMENT_CONFIDENCE</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00030">nars.io.Symbols.QUESTION_MARK</a>, and <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00040">nars.io.Symbols.VALUE_SEPARATOR</a>.</p>

<p>Referenced by <a class="el" href="../../d7/dcd/StringParser_8java_source.html#l00086">nars.io.StringParser.parseTask()</a>.</p>
<div class="fragment"><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;                                                              {</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        <span class="keywordflow">if</span> (type == <a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a771c007b010d86c032ee6d181f080ed8.html#a771c007b010d86c032ee6d181f080ed8">QUESTION_MARK</a>) {</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;            <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        }</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordtype">float</span> frequency = 1.0f;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <span class="keywordtype">float</span> confidence = <a class="code" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">Parameters</a>.<a class="code" href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a9b02deb2e403b931a0809a14c1754ae1.html#a9b02deb2e403b931a0809a14c1754ae1">DEFAULT_JUDGMENT_CONFIDENCE</a>;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordflow">if</span> (s != null) {</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            <span class="keywordtype">int</span> i = s.indexOf(<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4.html#a303071a44dc2adfc5d1b0a51058b9eb4">VALUE_SEPARATOR</a>);</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            <span class="keywordflow">if</span> (i &lt; 0) {</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;                frequency = Float.parseFloat(s);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;                frequency = Float.parseFloat(s.substring(0, i));</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;                confidence = Float.parseFloat(s.substring(i + 1));</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            }</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        }</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a>(frequency, confidence);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_html"><div class="ttname"><a href="../../d8/df4/classnars_1_1storage_1_1Memory.html">nars.storage.Memory</a></div><div class="ttdoc">The memory of the system. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l00051">Memory.java:51</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_1_1Parameters_html"><div class="ttname"><a href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters.html">nars.storage.Memory.Parameters</a></div><div class="ttdoc">Collected system parameters. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l01069">Memory.java:1069</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4_html_a303071a44dc2adfc5d1b0a51058b9eb4"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4.html#a303071a44dc2adfc5d1b0a51058b9eb4">nars.io.Symbols.VALUE_SEPARATOR</a></div><div class="ttdeci">static final char VALUE_SEPARATOR</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00040">Symbols.java:40</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_html"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">nars.entity.TruthValue</a></div><div class="ttdoc">Frequency and confidence. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00028">TruthValue.java:28</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Memory_1_1Parameters_a9b02deb2e403b931a0809a14c1754ae1_html_a9b02deb2e403b931a0809a14c1754ae1"><div class="ttname"><a href="../../da/d3b/classnars_1_1storage_1_1Memory_1_1Parameters_a9b02deb2e403b931a0809a14c1754ae1.html#a9b02deb2e403b931a0809a14c1754ae1">nars.storage.Memory.Parameters.DEFAULT_JUDGMENT_CONFIDENCE</a></div><div class="ttdeci">static final float DEFAULT_JUDGMENT_CONFIDENCE</div><div class="ttdoc">Default confidence of input judgment. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/d0c/Memory_8java_source.html#l01106">Memory.java:1106</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a771c007b010d86c032ee6d181f080ed8_html_a771c007b010d86c032ee6d181f080ed8"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a771c007b010d86c032ee6d181f080ed8.html#a771c007b010d86c032ee6d181f080ed8">nars.io.Symbols.QUESTION_MARK</a></div><div class="ttdeci">static final char QUESTION_MARK</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00030">Symbols.java:30</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d3/dca/classnars_1_1io_1_1StringParser_a49d3b8184f455de9685937d0aa2f6a93_a49d3b8184f455de9685937d0aa2f6a93_icgraph.svg" width="100%" height="300"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../db/d64/namespacenars_1_1io.html">io</a></li><li class="navelem"><a class="el" href="../../d3/dca/classnars_1_1io_1_1StringParser.html">StringParser</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
